/*
* ===================================================
*
*       Filename:  cell.cc
*
*
*        Created:  12/10/2011 10:04:27 AM
*       Revision:  none
*       Compiler:  gcc
*
*         Author:  durand_y, <durand.yoan@gmail.com>
*
* ===================================================
*/

#include "cell.hh"
# include "map.hh"

Cell::Cell (int x, int y)
	: interest_ (0)
{
	Piece* piece = new Piece (x, y);
	piece_ = piece;
	std::list <Pheromone *> l_phero;
	l_phero_ = l_phero;
	piece_ = piece;
}

Cell::Cell ()
	: piece_ (0),
	  interest_ (0)
{
	std::list <Pheromone *> l;
	l_phero_ = l;
}

Cell::~Cell ()
{
	delete piece_;
}

int
Cell::commute_interest (std::string type,
					  int team)
{
	std::list<Pheromone *>::iterator it;

	for (it = l_phero_.begin (); it != l_phero_.end (); ++it)
	{
		if (((*it)->get_type ().compare (type) == 0) &&
		   	((*it)->get_team () == team))
			interest_ += 1;
	}
	return (interest_);
}

